package com.ruoyi.house_sale.service.impl;

import com.ruoyi.house_sale.domain.*;
import com.ruoyi.house_sale.mapper.SalesGuideMapper;
import com.ruoyi.house_sale.service.ISalesGuideService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 房产资料Service业务层处理
 *
 * @author ruoyi
 * @date 2022-03-30
 */
@Service
public class SalesGuideServiceImpl implements ISalesGuideService
{
    @Resource
    private SalesGuideMapper salesGuideMapper;

    /**
     * 查询房产
     *
     * @param termid 楼栋资料主键
     * @return 房产列表
     */
    @Override
    public List<SalesGuide> getSalesGuideList(long termid)
    {
        return salesGuideMapper.getSalesGuideList(termid);
    }

    /**
     * 查询项目
     *
     * @return 项目列表
     */
    @Override
    public List<ProjectInfo> getProjectInfoList()
    {
        return salesGuideMapper.getProjectInfoList();
    }


    /**
     * 查询楼栋
     *
     * @return 楼栋列表
     */
    @Override
    public List<Terminfo> getTermInfoList(long projectid)
    {
        return salesGuideMapper.getTermInfoList(projectid);
    }


    /**
     * 修改销售状态
     *
     * @return 修改的记录数
     */
    @Override
    public int updateSaleState(Houseinfo houseinfo) {
        return salesGuideMapper.updateSaleState(houseinfo);
    }

    /**
     * 查询房产事件列表
     *
     * @param houseid 房产资料id
     * @return 房产事件集合
     */
    public List<HouseEvent> selectHouseEventList(Long houseid) {
        return salesGuideMapper.selectHouseEventList(houseid);
    }

    /**
     * 新增房产事件
     *
     * @param houseEvent 房产事件
     * @return 结果
     */
    public int insertHouseEvent(HouseEvent houseEvent) {
        return salesGuideMapper.insertHouseEvent(houseEvent);
    }
}
